package com.wangchenyang.common.sms.core.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 短信渠道枚举
 *
 */
@Getter
@AllArgsConstructor
public enum SmsChannelEnum {

	ALIYUN("ALIYUN", "阿里云"), TENCENT("TENCENT", "腾讯云"),;

	/**
	 * 编码
	 */
	private final String code;

	/**
	 * 名字
	 */
	private final String name;

	public static SmsChannelEnum getByCode(String code) {
		return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
	}

}
